package com.itnoob.handler.impl;

import com.itnoob.domain.Article;
import com.itnoob.handler.ReviewHandler;
import com.itnoob.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zhoujun
 * @date 2025/3/18 21:11
 */
@Component("SENSITIVE")
public class SensitiveWordReviewHandler implements ReviewHandler {


    @Autowired
    private ImageReviewHandler imageReviewHandler;

    @Override
    public Result review(Article article) {
        //进行敏感词审核
        //校验文章是否含有敏感词的逻辑
        boolean containsSensitiveWord = check(article.getContent());
        if (containsSensitiveWord){
            return new Result(false,"文章包含敏感词");
        }else {
            return new Result(true,"文章中不包含敏感词");
        }

    }

    private boolean check(String content) {
        System.out.println("检查是否含有敏感词...");
        return false;
    }
}
